import org from "@/api/org";
import { mapGetters } from "vuex";

/**
 * Created by Zhang JiRen
 * @date 2022/7/20 0020
 *
 * 组织列表获取
 */
export default {
  data: () => {
    return {
      company: []
    };
  },
  computed: mapGetters(["UserInfo"]),
  methods: {
    loadingOrgGetall() {
      return org
        .org_name_list()
        .then(res => {
          this.company = res.data.name_list;
          if (this.UserInfo.org_id) this.search.org_id = this.UserInfo.org_id;
        })
        .catch(() => {
          if (this.UserInfo.org_id) this.search.org_id = this.UserInfo.org_id;
        });
    }
  }
};
